@tool
extends Resource

## 对应库存UI界面中的一个物品槽
class_name InventoryItem


## 物品的id
@export var id: int:
    set(value):
        id = value
        _update_resource_name()

## 物品的个数
@export var count: int:
    set(value):
        count = value
        _update_resource_name()
        


func _to_string() -> String:
    return "[id: %d, count: %d]" % [id, count]


func _update_resource_name() -> void:
    resource_name = "id: %d, count: %d" % [id, count]


## 属性赋值
func setup(id_: int, count_: int) -> void:
    id = id_
    count = count_
